﻿using NUnit.Framework;

namespace IAD13.fromTDDtoBDD.TDD
{
    [TestFixture]
    public class AmountTests
    {
        private IAmount sut;

        [SetUp]
        public void SetUp()
        {
            sut = new Amount(100, new Currency("EUR"));
        }

        [Test]
        public void GetValue()
        {
            Assert.AreEqual(100, sut.Value);
        }

        [Test]
        public void GetCurrency()
        {
            Assert.AreEqual("EUR", sut.Currency.Value);
        }

        [Test]
        public void GetFormatedValue()
        {
           Assert.AreEqual("100 EUR", sut.ToString()); 
        }

        [Test]
        public void IsEqual()
        {
            Assert.AreEqual(new Amount(100,new Currency("EUR")), sut);
        }

        [Test]
        public void IsNotEqualByValue()
        {
            Assert.AreNotEqual(new Amount(101, new Currency("EUR")), sut);
        }

        [Test]
        public void IsNotEqualByCurrency()
        {
            Assert.AreNotEqual(new Amount(100, new Currency("USD")), sut);
        }
    }
}